<?
session_start();
require 'smarty-2.6.22/Smarty.class.php';
include 'db.php';

$smarty = new Smarty;
$sql = 	"SELECT u.`usu_id`
		FROM usuarios u
		WHERE u.`usu_eMail`= '".$_POST['txtUsuario']."' AND u.`usu_password`= '".md5($_POST['txtPassword'])."'";
//echo $sql." ";		
$result = $db->query($sql);
$result = $result->fetch_assoc();
if($result){
	$_SESSION['id_usu']=$result['usu_id'];
	header('Location:../home.php');
}
else{
	header('Location:../index.php?msj=1');
}

function recordar( $usuario,$clave) {
	setcookie("usu", $usuario);
	setcookie("cla", $clave);
}
?>